/* rayures.js */

$(function() {
  align_layout();
  align_form_labels();
});

function align_layout() {
  var divs = ['left', 'center', 'right'];

  var total_height = $('html').height();
  var header_height = $('#layout_header').height();
  var footer_height = $('#layout_footer').height();
  var min_height = total_height - header_height - footer_height;
  $.each(divs, function(i, val) {
    $('#layout_' + val).height(min_height);
  });
}

function align_form_labels() {
  var max_width = 0;
  $('.form-field label').each(function(i, val) {
    var width = $(val).width();
    if (width > max_width) {
      max_width = width;
    }
  });
  $('.form-field label').width(max_width);
}
